<?php
/**
 * User: wangjh
 * DateTime: 2018/1/9 16:37
 */
$config =  array('host' => 'localhost', 'port' => '5672', 'login' => 'guest', 'password' => 'guest');

$connection = new AMQPConnection($config);
$m = $connection->connect();

if(!$m){
	die("Couldn't connection to server". $config['host']);
}

$channel = new AMQPChannel($connection);

$queue = new AMQPQueue($channel);
$queue->setName("wangjh");
$res = $queue->get();
if(!$res){
	die("There is not any message to be delt!");
}
echo "<pre>";
$tag = $res->getDeliveryTag();
print_r($res->getBody());
//$tmp = $queue->ack($tag);
